<template>
	<div class="content">
		<div class="main">
			<!-- 第一个tabs 基本信息 药典 -->
			<el-dialog :title="dialogTitle" v-dialogDrag :visible.sync="dialogFormVisible" width="48%" :before-close="handleClose" top="10px">
				<div class="add">
					<!-- 分割标题 -->
					<div class="formTypeHeader">
						<!-- 表单 -->
						<el-form ref="addForm" :rules="headerRules" :model="addForm" size="mini" :disabled="!isShow">
							<el-row :gutter="24">
								<el-col :xs="v.xs" :sm="v.xs" :md="v.md" :lg="v.lg" :xl="v.xl" type="flex" v-for="(v,i) in formTypeHeader" :key="i">
									<!-- selectName -->
									<el-form-item v-if="v.type == 'selectName'" :label="v.label" :prop="v.modelValue">
										<el-select 
										  v-model="$data.addForm[v.modelValue]" 
										  :disabled="v.disabled" 
										  filterable
										  remote
										  :remote-method="searchNameMethod"
										  @focus="handlefoucsName(v,i)" 
										  @change="handleNameChange" 
										  :popper-append-to-body="false"
										  :loading="loading"
										>
										<!-- 选项组 -->
										<el-group>
										  <!-- 固定头部 -->
										  <div class="select-header" slot="header" 
										  style="font-size: 12px;font-weight: bold;display: flex;justify-content: space-between;padding: 8px;
										  position: sticky;top:0;z-index: 10;background-color: #f1f1f1;">
										    <span style="width: 48px;">药品序号</span>
										    <span>药品名称</span>
										    <span>规格</span>
											<span>药品编码</span>
											<span>剂型</span>
											<span>厂家</span>
										  </div>
										  <el-option 
										    v-for="item in $data[v.op]" 
										    :key="item._uid" 
										    :label="item.label" 
										    :value="item.id"
										  >
										    <div id="optionItem">
										      <span style="width: 48px;">{{ item.id }}</span>
										      <span>{{ item.label }}</span>
										      <el-tooltip class="item" effect="light" :content="item.specifications" placement="top">
										        <span>{{ item.specifications }}</span>
										      </el-tooltip>
										      <span>{{ item.drugCode }}</span>
										      <span>{{ item.dosageForm }}</span>
										      <span>{{ item.licensorChinese }}</span>
										    </div>
										  </el-option>
										  </el-group>
										  <!-- 加载状态提示 -->
										  <div v-if="loading" slot="empty" class="load-more">
										    <i class="el-icon-loading"></i> 加载中...
										  </div>
										  <div v-else-if="scrollLoading" slot="empty" class="load-more">
										    <i class="el-icon-loading"></i> 加载更多...
										  </div>
										  <div v-else-if="!hasMore && NameOptions.length > 0" slot="empty" class="load-more">
										    没有更多数据了
										  </div>
										  <div v-else-if="NameOptions.length === 0" slot="empty" class="load-more">
										    暂无数据
										  </div>
										</el-select>
									</el-form-item>
									<!-- btn -->
									<el-form-item v-if="v.type == 'btn'" :prop="v.modelValue">
										<el-button type="success" @click="copyDrugName" icon="el-icon-document-copy">复制</el-button>
										<el-button type="primary" @click="seeDeatils" >{{v.label}}</el-button>
									</el-form-item>
									<!-- input -->
									<el-form-item v-if="v.type == 'input'" :label="v.label" :prop="v.modelValue">
										<el-input v-model="$data.addForm[v.modelValue]" :disabled="v.disabled"></el-input>
									</el-form-item>
									<!-- select -->
									<el-form-item v-if="v.type == 'select'" :label="v.label" :prop="v.modelValue">
										<el-select style="width: 88px;" v-model="$data.addForm[v.modelValue]" filterable :disabled="v.disabled" :placeholder="v.placeholder">
											<el-option v-for="item in $data[v.op]" :key="item.id" :label="item.label" :value="item.id">
												<span style="font-size: 12px;">{{ item.label }}</span>
											</el-option>
										</el-select>
									</el-form-item>
								</el-col>
							</el-row>
						</el-form>
					</div>
					<!-- 分割主题 -->
					<div class="formTypeMain">
						<!-- 表单 -->
						<el-tabs type="border-card" v-model="activeTab" @tab-click="handleTabChange">
							<el-tab-pane label="基本信息[F2]" name="a">
							<div class="addFormA">
							<el-form ref="addFormA" :rules="addRules" :model="addForm" size="mini" :label-position="labelPosition"
							 :disabled="!isShow">
								<el-row :gutter="24">
									<el-col :xs="v.xs" :sm="v.xs" :md="v.md" :lg="v.lg" :xl="v.xl" type="flex" v-for="(v,i) in formTypeMain" :key="i">
										<!-- input -->
										<el-form-item v-if="v.type == 'input'" :label="v.label" :prop="v.modelValue">
											<el-input v-model="$data.addForm[v.modelValue]" :disabled="v.disabled" @blur="inputHeaderChance(v,i)"></el-input>
											<span v-if="v.label.includes('比例')" 
											      style="position: absolute; right: 10px; top: 50%; transform: translateY(-50%);"
											>%</span>
										</el-form-item>
										<!-- select -->
										<el-form-item v-if="v.type == 'select'" :label="v.label" :prop="v.modelValue">
											<el-select v-model="$data.addForm[v.modelValue]" filterable @focus="handlefoucsA(v,i)" @change="handleChangeA"
											:disabled="v.disabled" placeholder="">
												<el-option v-for="item in $data[v.op]" :key="item.id" :label="item.label" :value="item.id">
													<span>{{ item.label }}</span>
												</el-option>
											</el-select>
										</el-form-item>
										<!-- select -->
										<div class="selectInput">
											<!-- input -->
											<el-form-item v-if="v.type == 'Inputselect'" :label="v.label" :prop="v.modelValue">
												<el-input v-model="$data.addForm[v.modelValue]" :disabled="v.disabled" @blur="inputHeaderChance(v,i)"></el-input>
											</el-form-item>
											<el-form-item v-if="v.type == 'selectInput'" :label="v.label" :prop="v.modelValue">
												<el-select v-model="$data.addForm[v.modelValue]" filterable @focus="handlefoucsA(v,i)" @change="handleChangeA"
												:disabled="v.disabled" placeholder="">
													<el-option v-for="item in $data[v.op]" :key="item.id" :label="item.label" :value="item.id">
														<span>{{ item.label }}</span>
													</el-option>
												</el-select>
											</el-form-item>
										</div>
										<!-- select -->
										<div class="selectInput2">
											<!-- input -->
											<el-form-item v-if="v.type == 'Inputselect2'" :label="v.label" :prop="v.modelValue">
												<el-input v-model="$data.addForm[v.modelValue]" :disabled="v.disabled" @blur="inputHeaderChance(v,i)"></el-input>
											</el-form-item>
											<el-form-item v-if="v.type == 'selectInput2'" :label="v.label" :prop="v.modelValue">
												<el-select v-model="$data.addForm[v.modelValue]" filterable @focus="handlefoucsA(v,i)" @change="handleChangeA"
												:disabled="v.disabled" placeholder="">
													<el-option v-for="item in $data[v.op]" :key="item.id" :label="item.label" :value="item.id">
														<span>{{ item.label }}</span>
													</el-option>
												</el-select>
											</el-form-item>
										</div>
										
									</el-col>
								</el-row>
							</el-form>
							</div>
						</el-tab-pane>
						
						<el-tab-pane label="扩展内容[F4]" name="c">
							<div class="addFormC">
							<el-form ref="addFormC" :rules="addRules" :model="addForm" size="mini" :disabled="!isShow" 
							label-position="right" label-width="99px">
								<el-row :gutter="24">
									<el-col :xs="v.xs" :sm="v.xs" :md="v.md" :lg="v.lg" :xl="v.xl" type="flex" v-for="(v,i) in formTypeMainC" :key="i">
										<!-- input -->
										<el-form-item v-if="v.type == 'input'" :label="v.label" :prop="v.modelValue">
											<el-input v-model="$data.addForm[v.modelValue]" :disabled="v.disabled" @blur="inputChance(v,i)"></el-input>
										</el-form-item>
										<!-- checked -->
										<el-form-item v-if="v.type == 'checked'" :label="v.label" :prop="v.modelValue">
											<el-checkbox v-model="isChecked" @change="toggleYesNo"></el-checkbox>
										</el-form-item>
										<!-- checked2 -->
										<el-form-item v-if="v.type == 'checked2'" :label="v.label" :prop="v.modelValue">
											<el-checkbox v-model="isChecked2" @change="toggleSkintstDicmYesNo"></el-checkbox>
										</el-form-item>
										<!-- textarea -->
										<el-form-item v-if="v.type == 'textarea'" :label="v.label" :prop="v.modelValue">
											<el-input type="textarea" :rows="2" v-model="$data.addForm[v.modelValue]"></el-input>
										</el-form-item>
										<!-- select -->
										<el-form-item v-if="v.type == 'select'" :label="v.label" :prop="v.modelValue">
											<el-select v-model="$data.addForm[v.modelValue]" filterable :disabled="v.disabled ? disabledC : v.disabled"
											@focus="handlefoucsC(v,i)" @change="handleChangeC" placeholder="">
												<el-option v-for="item in $data[v.op]" :key="item.id" :label="item.label" :value="item.id">
													<span style="font-size: 12px;">{{ item.label }}</span>
												</el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
							</el-form>
							</div>
						</el-tab-pane>
						<el-tab-pane label="使用注意[F6]" name="d">
							<!-- 表单 -->
							<div class="addFormC">
							<el-form ref="addFormC" :rules="addRules" :model="addForm" size="mini" :disabled="!isShow" :label-position="labelPosition" label-width="100px">
								<el-row :gutter="20">
									<el-col :xs="v.xs" :sm="v.xs" :md="v.md" :lg="v.lg" :xl="v.xl" type="flex" v-for="(v,i) in formTypeMainC" :key="i">
										<!-- textarea -->
										<el-form-item v-if="v.type == 'textarea2'" :label="v.label" :prop="v.prop">
											<el-input type="textarea" :rows="2" v-model="$data.addForm[v.modelValue]"></el-input>
										</el-form-item>
									</el-col>
								</el-row>
							</el-form>
							</div>
						</el-tab-pane>
					</el-tabs>
					</div>
					<!-- 底部表格区域 (feet) -->
					<div class="form-feet">
					  <div class="CJ">
					    <div class="CJ-title">
					      <span class="title-text">厂家信息</span>
					      <div class="title-buttons">
							  <li style="list-style-type: none;margin-right: 12px;">
							  	<el-button v-for="(v,i) in boxaBtn" :key="i" :type="v.type" :icon="v.icon" size="medium" 
							  	@click="boxaBtnHandClick(i)"></el-button>
							  </li>
					       <!-- <el-button type="text" icon="el-icon-plus" @click="addManufacturer"></el-button>
					        <el-button type="text" icon="el-icon-edit" @click="editManufacturer"></el-button>
					        <el-button type="text" icon="el-icon-delete" @click="deleteManufacturer"></el-button> -->
					      </div>
					    </div>
					    <div class="CJ-table">
					      <el-table
					        :data="manufacturerData"
					        border
					        style="width: 100%"
					        height="100%">
					        <el-table-column
					          type="index"
					          label="行号"
					          width="50"
					          align="center">
					        </el-table-column>
					        <el-table-column
					          prop="manufacturerName"
					          label="生产厂家"
					          width="180">
					        </el-table-column>
					        <el-table-column
					          prop="insuranceCode"
					          label="保险编码"
					          width="120">
					        </el-table-column>
					        <el-table-column
					          prop="insuranceType"
					          label="保险类"
					          width="120">
					        </el-table-column>
					        <el-table-column
					          prop="origin"
					          label="产地"
					          width="120">
					        </el-table-column>
					        <el-table-column
					          prop="registrant"
					          label="注册商"
					          width="120">
					        </el-table-column>
					        <el-table-column
					          prop="approvalNumber"
					          label="批准文号"
					          width="150">
					        </el-table-column>
					        <el-table-column
					          prop="factory"
					          label="生产厂"
					          width="120">
					        </el-table-column>
					        <el-table-column
					          prop="selfPayRatio"
					          label="自付比例"
					          width="100">
					        </el-table-column>
					      </el-table>
					    </div>
					  </div>
					</div>
					<!-- 在子组件的dialog-footer部分修改为以下代码 -->
					<div slot="footer" class="dialog-footer" v-if="isShow">
					  <el-button v-if="dialogTitle === '新增'" size="mini" type="primary" @click="submitForm">新增</el-button>
					  <el-button v-if="dialogTitle === '编辑'" size="mini" type="primary" @click="submitEditForm">保存</el-button>
					  <el-button v-if="dialogTitle !== '查看'" size="mini" @click="dialogFormVisible = false">关闭</el-button>
					  <!-- <el-button v-if="dialogTitle === '查看'" size="mini" @click="dialogFormVisible = false">关闭</el-button> -->
					</div>
				</div>
			</el-dialog>						
		</div>
		<div class="feet">
			<!-- 厂家新增选择Model -->
			<div class="GetManuFact">
				<el-dialog
				  title="新增厂家"
				  :visible.sync="GetManuFactDialogVisible"
				  width="40%"
				  top="48px"
				  :before-close="handleMacnFactClose">
				  <!-- 表单 -->
				  <div class="form">
					<!-- 厂家表单 -->
					<el-form ref="addManFatcRules" :rules="addManFatcRules" :model="addManfacterForm" size="mini">
						<el-row :gutter="20">
							<el-col :xs="v.xs" :sm="v.xs" :md="v.md" :lg="v.lg" :xl="v.xl" type="flex" v-for="(v,i) in addManfacterFormType" :key="i">
								<!-- input -->
								<el-form-item v-if="v.type == 'input'" :label="v.label" :prop="v.modelValue">
									<el-input v-model="$data.addManfacterForm[v.modelValue]"></el-input>
								</el-form-item>
								<!-- select -->
								<el-form-item v-if="v.type == 'selectFirst'" :label="v.label" :prop="v.modelValue">
									<el-select v-model="$data.addManfacterForm[v.modelValue]" :disabled="v.disabled ? addDisabled : v.disabled" filterable
									@focus="handlefoucs(v,i)" @change="handleChangeManfacter" :filter-method="searchMethod" :popper-append-to-body="false">
										<el-option v-for="item in $data[v.op]" :key="item.id" :label="item.label" :value="item.id" v-loading="loading">
											<div id="optionItem">
												<span style="width: 58px;">{{ item.id }}</span>
												<span style="width: 188px;text-align: left;">{{ item.label }}</span>
												<span style="width: 48px;text-align: center;">{{ item.coding }}</span>
												<span style="width: 68px;">{{ item.origin }}</span>
											</div>
										</el-option>
									</el-select>
								</el-form-item>
								<!-- select -->
								<el-form-item v-if="v.type == 'select'" :label="v.label" :prop="v.modelValue">
									<el-select v-model="$data.addManfacterForm[v.modelValue]" filterable placeholder="请选择" :disabled="v.disabled">
									  <el-option v-for="item in $data[v.op]" :key="item.id" :label="item.label" :value="item.id"> 
									    <span style="font-size: 12px">{{ item.label }}</span>
									  </el-option>
									</el-select>
								</el-form-item>
							</el-col>
						</el-row>
					</el-form>
				  </div>
				  <span slot="footer" class="dialog-footer">
				    <el-button size="mini" plain type="primary" @click="GetManuFact">保存</el-button>
				    <el-button size="mini" plain type="primary" @click="GetManuFactDialogVisible = false">取 消</el-button>
				  </span>
				</el-dialog>
			</div>
		</div>
		
		<!-- 药典详情 -->
		<div class="details">
			<el-dialog
			  title="查看【西药】药典详情"
			  :visible.sync="seeDetails"
			  width="40%"
			  :before-close="handleCloseDetails">
			  <el-descriptions :title="drugData.label" direction="vertical" :column="5" border>
			    <el-descriptions-item label="药品序号">{{ drugData.id }}</el-descriptions-item>
			    <el-descriptions-item label="药品编码">{{ drugData.drugCode }}</el-descriptions-item>
			    <el-descriptions-item label="药品剂型">{{ drugData.dosageForm }}</el-descriptions-item>
				<el-descriptions-item label="批准文号">{{ drugData.approvalNumber }}</el-descriptions-item>
			    <el-descriptions-item label="生产厂家">
			      <el-tag size="small">{{ drugData.licensorChinese }}</el-tag>
			    </el-descriptions-item>
			    <el-descriptions-item label="规格描述">{{ drugData.specifications }}</el-descriptions-item>
			  </el-descriptions>
			  <span slot="footer" class="dialog-footer">
			    <el-button size="mini" type="primary" @click="seeDetails = false">关闭</el-button>
			  </span>
			</el-dialog>
		</div>
		
	</div>
</template>

<script>
	// selfs / props

	// selfs / js
	import addForm from './addForm.js' //Form表单
	import addDialogType from './addDialogType.js' //Form表单
	import addManFacterType from './addManFacterType.js' //Form厂家Model表单结构
	import Pinyin from "@/external/pinyin.js"; //中译音
	// axios
	import {
		getDInfo,getDrugUnt,getDosaUnt,getMedicationFrequency,getMedicationWay,getEisai,getMedcas,
		getDrugType,selectDrugDosageForm,addDrugs,
		selectCateGory,selectOneCateGory,selectTwoCateGory,selectThreeCateGory,
		selectDocVtByType,getRecordCategory,docMarkById
	} 
	from "@/api/MedicenCata.js";
	
	import { addDrugInformation,updateDrugInformation,getDInfos } from "@/api/systemCatalogue/MedicenCata.js";

	import { getManufacturer } from "@/api/systemCatalogue/MedicenCata.js"; // 厂家
	import { dict } from "@/api/staff/staff.js"; // 数据字典
	export default {
		inject: ['reload'], // 无痕刷新
		components: {
			
		},
		props: ['parentMethod'],
		data() {
			return {
				// str
				idcode:'', //参数储存 IdCode
				idcodeIII:'', //参数储存 IdCode
				dialogTitle:'', // dialog-Title
				markUpRate:'',
				labelPosition:'right',
				getValue:'',
				value:'',
				activeTab:'a',
				inputSearchValue:'', // 药典模糊关键字
				inputSearchManfactValue:'', // 厂家模糊关键字
				ToSendDrugCode:'', //传给子组件新增的药品本位码
				// number
				idx:0,
				pageNum: 1, //当前页currentPage
				pageSize: 48, //每页展示条数
				totalSize: 10, //总条数
				// blean
				DetailsDialogVisible:false, // model
				dialogFormVisible: true, // model
				seeDetails:false, // 药典详情
				GetManuFactDialogVisible:false,
				loading:false,
				MainFormAbled:true,
				disabledC:true,
				isShow:true,
				editShow:false,
				antc:0, // 抗生素
				skintstDicm:0, // 皮试
				isChecked:false, // 允许录入小数
				isChecked2:false, // 自备药品
				// arr
				formTypeHeader:[],
				drugData:{}, // 药品数据源
				ManufacturerData:[], // 厂家数据源
				ManufacturerOptions:[], // 厂家数据源
				//厂家rows
				ManufacturerDataRows:[
					{ name:"生产厂家", prop:"manufacturerName", type:"" },{ name:"有效期天数", prop:"expyDate" },
					{ name:"医保名称", prop:"chsName", type:"" },
					{ name:"医保编码", prop:"chsCode", type:"" },{ name:"产地", prop:"orplc", type:"" },
					{ name:"网采编码", prop:"netCode", type:"" },{ name:"有效状态", prop:"state", type:"" },
					{ name:"自付比例", prop:"ratio", type:"" },{ name:"中标等级", prop:"orplc", type:"" },
					{ name:"中标次数", prop:"bidCnt", type:"" },{ name:"药品ypId", prop:"ypId", type:"" },
					{ name:"批准文号", prop:"manuLotnum", type:"" },{ name:"备注", prop:"remark", type:"" },
				],
				boxaBtn:[
					{add:"add",type:"text",icon:"el-icon-plus"},
					{adit:"adit",type:"text",icon:"el-icon-edit"},
					{del:"del",type:"text",icon:"el-icon-del"},
				],
				formTypeMain:[],
				formTypeMainC:[], // 表单C结构
				addManfacterFormType:[],
				currentTable:[], // 表格单选
				options:[],
				NameOptions:[],
				itemsForObj:[],
				unitDoseOptions:[], // 包装单位
				getDosaUntOptions:[], // 剂量单位
				getMinUntOptions:[], // 最小单位
				methodTypeOptions:[], // 默认制法
				poisonousTypeOption:[], //dm
				YNoptions:[{id:0,label:'否',value:'否'},{id:1,label:'是',value:'是'}],
				statusOptions:[{id:0,label:'禁用'},{id:1,label:'可用'}],
				drugTypeOption:[{id:1,label:'西药'},{id:2,label:'成药'},{id:3,label:'卫材'},{id:4,label:'血液'},{id:5,label:'疫苗'}], // 药品类型
				drugCategoryOption:[], // yllb I
				drugCategoryChildOption:[], //yllb II
				threeLevelDrugCategoryOption:[], //yllb III
				UseOptions:[{ id:0,label:'全院',value:'全院'},{ id:1,label:'门诊',value:'门诊'},{ id:2,label:'其他',value:'其他'}], // 适用范围
				gatherBuyTypeOptions:[{ id:1,label:'中选'},{ id:2,label:'非中选'}],
				dosformOptions:[{ id:1,label:'西药'},{ id:2,label:'中药'}],
				markUpOption:[{ id:1,label:'比例加成',value:'比例加成'},{ id:2,label:'固定加成',value:'固定加成'},
				{ id:3,label:'手工比例加成',value:'手工比例加成'},{ id:4,label:'不加成',value:'不加成'}],
				expensiveTypeOptions:[{id:1,label:'普价'},{id:2,label:'贵重'},{id:3,label:'昂贵'},{id:4,label:'免费'}],
				antcLvOption:[ // 抗生素等级
					{ id:1,label:'一级抗生素(非限制使用)',value:'一级抗生素(非限制使用)'},{ id:2,label:'二级抗生素(限制使用)',value:'二级抗生素(限制使用)'},
					{ id:3,label:'三级抗生素(特殊使用)',value:'三级抗生素(特殊使用)'},
				],
				highRiskOption:[ // 高危
					{ id:0,label:'非高危药品',value:'非高危药品'},{ id:1,label:' A级高危',value:' A级高危'},{ id:2,label:'B级高危',value:'B级高危'},
					{ id:3,label:'C级高危',value:'C级高危'},
				],
				medicalRecordFeeOption:[], //病案费别
				gatherBuyTypeOption:[{id:1,label:'中选',value:'中选'},{id:2,label:'非中选',value:'非中选'}], // 集采中选
				saleOptions:[{id:1,label:'最小单位',value:'最小单位'},{id:2,label:'包装单位',value:'包装单位'}], // 零售单位
				medcWayIdOptions:[], // 用药频率
				usedFrquIdOptions:[], // 默认给药方式
				liquidOptions:[{ id:0,label:'非液体',value:'非液体'},{ id:1,label:'大液体',value:'大液体'},{ id:2,label:'小液体',value:'小液体'}], // 是否液体
				chargedSpcOptions:[{id:0,label:'全部',value:'全部'},{id:1,label:'门诊',value:'门诊'},{id:2,label:'其他',value:'其他'},{id:3,label:'不计费',value:'不计费'}],
				isAntibioticOption:[{id:1,label:'一级抗生素',value:'一级抗生素'},{id:2,label:'二级抗生素',value:'二级抗生素'},{id:3,label:'三级抗生素',value:'三级抗生素'}],
				qualityCategory:[{id:1,label:'一类',value:'一类'},{id:2,label:'二类',value:'二类'},{id:3,label:'三类',value:'三类'}],
				basicTypeOptions:[{ id:1,label:'国家基药',value:'国家基药'},{ id:2,label:'省级基药',value:'省级基药'},{ id:3,label:'地区基药',value:'地区基药'}], //基药类型
				saveOptions:[//储存条件
					{ id:1,label:'常温(0~30°)',value:'常温(0~30°)'},{ id:2,label:'阴凉(2~20°)',value:'阴凉(2~20°)'},
					{ id:3,label:'冷藏(2~8°)',value:'冷藏(2~8°)'},{ id:4,label:'凉暗(2~20°且避光)',value:'凉暗(2~20°且避光)'},
				],
				nurturebOption:[{ id:0,label:'否',value:'否'},{ id:1,label:'普通',value:'普通'},{ id:2,label:'重点',value:'重点'},{ id:3,label:'特殊',value:'特殊'}],
				nurtureOption:[{ id:1,label:'常规养护',value:'常规养护'},{ id:2,label:'重点养护',value:'重点养护'}],
				roundUntoptions:[{id:1,label:'单次取整',value:'单次取整'},{id:3,label:'处方取整',value:'处方取整'}],
				// obj
				addForm:{}, //form主体表单 * 
				addManfacterForm:{},  //form厂家表单 * 
				param:{},
				headerRules:{
					drugCodeName:[{ required:true,message:'此项为必选项',trigger:'change' }],
					drugType:[{ required:true,message:'药品类型为必选项',trigger:'change' }],
				},
				addRules:{
					drugCodeId:[{ required:true,message:'此项必填',trigger:'change' }],
					code:[{ required: true, message: "此项必填", trigger: "change" }],
					name: [{ required: true, message: "此项必填", trigger: "change" }],
					pacUnt: [{ required: true, message: "此项必填", trigger: "blur" }],
					pacCnt: [{ required: true, message: "此项必填", trigger: "blur" }],
					unitDose: [{ required: true, message: "此项必填", trigger: "blur" }],
					dosUnt: [{ required: true, message: "此项必填", trigger: "blur" }],
					minDose: [{ required: true, message: "此项必填", trigger: "blur" }],
					minDoseNum: [{ required: true, message: "此项必填", trigger: "blur" }],
					minUnt: [{ required: true, message: "此项必填", trigger: "blur" }],
					markUpId: [{ required: true, message: "此项为必选项", trigger: "blur" }],
					markUpRate: [ { required: false,pattern:/^[1-9]\d*(\.\d+)?$/, message: '比例格式错误！', trigger: 'change' }],
					markUpPric: [ { required: true,pattern:/^[1-9]\d*(\.\d+)?$/, message: '格式错误！', trigger: 'change' }],
				},
				// 厂家信息规则
				addManFatcRules:{
					prodentpId: [{ required: false, message: "请先选择厂家名称！", trigger: "change" }],
					expyDate: [{ required: false,pattern:/^[1-9]\d*(\.\d+)?$/, message: "格式不正确！", trigger: "blur" }],
					ratio: [{ required: false,pattern:/^[1-9]\d*(\.\d+)?$/, message: "格式不正确！", trigger: "blur" }],
				},
				elTree:[
					{ id:1,label: '西药',path:'',title:'西药',icon:'el-icon-xy'},
					{ id:2,label: '中成药',path:'',title:'中成药',icon:'el-icon-zhongchengyao'},
					{ id:3,label: '中草药',path:'',title:'中草药',icon:'el-icon-zhongcaoyao'},
					{ id:4,label: '民族药',path:'',title:'民族药',icon:'el-icon-xyzp'},
					{ id:5,label: '卫材',path:'',title:'卫材',icon:'el-icon-xyjhtxyyzhy'},
					{ id:6,label: '血液',path:'',title:'血液',icon:'el-icon-blood'},
					{ id:7,label: '疫苗',path:'',title:'疫苗',icon:'el-icon-yimiaoke'},
					{ id:8,label: '检验试剂',path:'',title:'检验试剂',icon:'el-icon-tjxg'},
					{ id:9,label: '营养',path:'',title:'营养',icon:'el-icon-cnyyyy'},
				],
				// external
				pickerOptions: {
				  shortcuts: [
					{ text: '今天', onClick(picker) { picker.$emit('pick', new Date()); }}, 
					{ text: '昨天', onClick(picker) { const date = new Date();date.setTime(date.getTime() - 3600 * 1000 * 24);picker.$emit('pick', date);}}, 
					{ text: '一周前',onClick(picker) {const date = new Date();date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);picker.$emit('pick', date);}},
					]
				},
				// props
				//zdy
				// 无限滚动相关
				allSearchResults: [], // 全部搜索结果
				displayedResults: [], // 当前显示结果
				displayBatchSize: 99, // 每批显示数量
				currentDisplayPage: 1, // 当前显示页
				scrollLoading: false, // 加载状态
				hasMore: true, // 是否有更多数据
				scrollDebounce: null // 防抖计时器
			}
		},
		// life
		mounted() {
			this.getForm();
			this.pacUnt(); // 包装单位
			this.getDocVtByType(); // 毒麻
			this.selectOneCateGory(); // 药理类别
			this.getDosaUnts(); // 剂量单位
			this.getditc(); // 数据字典
			this.getMedcas(); // 病案费别
			this.getMedicationFrequency(); // 给药方式
			this.getMedicationWay(); // 用药频率 
			// 监听全局键盘事件
			window.addEventListener('keydown', this.handleKeyPress);
			this.$nextTick(() => {
			    const scrollWrap = this.getScrollWrap();
			    if (scrollWrap) {
			      scrollWrap.addEventListener('scroll', this.handleScroll);
			    }
			  });
		},
		methods: {
			/* 数据源 */
			async loadData(){
				// 厂家接口
				//  模糊搜索接口select函数
				let res = await getManufacturer({
					manufacturerName:this.inputSearchManfactValue,
					pageNum: this.pageNum,
					pageSize: this.pageSize
				})
				if(res.code === 200){
					this.inputSearchManfactValue == '' ? this.loading = false : this.loading = true;
					setTimeout(() =>{
						this.ManufacturerOptions = res.data.content.map(v=>{
							return { id:v.id,prodentpId:v.id,label: v.manufacturerName,origin:v.origin,coding:v.coding}
						})
						// console.log(this.ManufacturerOptions);
						this.loading = false
						this.$message({ type: "success", message: res.message });
					},888)
				}else{
					this.$message.error(res.message)
					// this.NameOptions = [];
				}
			},
			// 挂载或销毁前后重新赋值后端参数
			getForm(){
				// 左侧提交表单
				this.addForm = addForm.map(v => {return v })[0]; // Form
				// 厂家
				this.addManfacterForm = this.addForm.list[0]
				// 定义数据来源
				this.formTypeHeader = addDialogType.map(function(val) { return val }).slice(0,6)
				this.formTypeMain = addDialogType.map(function(val) { return val }).slice(6,33)
				this.formTypeMainC = addDialogType.map(function(val) { return val }).slice(33)
				// 解构赋值排除 list 属性 => 弃用
				// this.addHeadrForm = addForm.map(item => { let { list, ...newItem } = item; return newItem })[0];
			},
			// 复制药品名称
			  copyDrugName() {
			    // 检查是否已选择药品
			    if (!this.addForm.drugName) {
			      this.$message.warning('请先选择药品信息');
			      return;
			    }
			    
			    // 创建临时textarea元素
			    const textarea = document.createElement('textarea');
			    textarea.value = this.addForm.drugName;
			    textarea.style.position = 'fixed';  // 防止页面滚动
			    document.body.appendChild(textarea);
			    textarea.select();
			    
			    try {
			      // 执行复制命令
			      const successful = document.execCommand('copy');
			      if (successful) {
			        this.$message.success('药品名称已复制到剪贴板');
			      } else {
			        this.$message.error('复制失败，请手动复制');
			      }
			    } catch (err) {
			      this.$message.error('复制失败: ' + err);
			    }
			    
			    // 移除临时元素
			    document.body.removeChild(textarea);
			  },
			// 默认制法 <= 数据字典
			async getditc(){
			   let res = await dict();
			   if(res.code===200){ this.methodTypeOptions=res.data.tcmway.map(v => {return {id:v.id, label: v.name, ...v}}) }else{ this.$message.error(res.message) }
			},
			// 区间判断取值并计算销售单价
			  checkValueInRange(rreess) {
			    // 获取当前登录诊所ID
			    const userInfo = JSON.parse(localStorage.getItem('userInfo'));
			    const currentClinicId = userInfo?.clinicId || '';
			    
			    // 按 id 顺序遍历数组
			    let matchedItems = [];
			    
			    // 先过滤掉markUpType不等于1的对象和clinicId不匹配的对象
			    rreess = rreess.filter(rule => 
			      rule.markUpType === 1 && 
			      (rule.clinicId === currentClinicId || !rule.clinicId)
			    );
			    
			    if (rreess.length === 0) {
			      console.warn('没有找到匹配当前诊所的加成率规则');
			      this.addForm.markUpRate = 1;
			      this.addForm.markUpId = this.addForm.markUpId || 0;
			      
			      // 计算销售单价：salePric = costPric * (1 + markUpRate)
			      if (this.addForm.costPric && this.addForm.costPric > 0) {
			        this.addForm.salePric = (this.addForm.costPric * (1 + this.addForm.markUpRate)).toFixed(2);
			      }
			      return {
			        markUpRate: 1,
			        markUpId: this.addForm.markUpId || 0
			      };
			    }
			    
			    // 遍历所有对象，收集匹配的区间
			    rreess.forEach(item => {
			      const min = Math.min(item.pricLmtLow, item.pricLmtTop);
			      const max = Math.max(item.pricLmtLow, item.pricLmtTop);
			      
			      if (this.addForm.costPric >= min && this.addForm.costPric <= max) {
			        matchedItems.push(item);
			      }
			    });
			    
			    // 如果有匹配项，选择 id 最大的对象
			    if (matchedItems.length > 0) {
			      const targetItem = matchedItems.reduce((prev, current) => 
			        (prev.id > current.id) ? prev : current
			      );
			      console.log('匹配到的加成率规则:', targetItem);
			      this.addForm.markUpRate = this.markUpRate = targetItem.markUpRate;
			      
			      // 计算销售单价：salePric = costPric * (1 + markUpRate)
			      if (this.addForm.costPric && this.addForm.costPric > 0) {
			        this.addForm.salePric = (this.addForm.costPric * (1 + this.addForm.markUpRate)).toFixed(2);
			      }
			    } else {
			      this.addForm.markUpRate = null; // 无匹配
			      this.addForm.salePric = ''; // 清空销售单价
			    }
			  },
			  // 修改后的getDocMark方法
			    async getDocMark() {
			      try {
			        this.loading = true;
			        // 获取当前登录诊所ID
			        const userInfo = JSON.parse(localStorage.getItem('userInfo'));
			        const clinicId = userInfo?.clinicId || '';
			        
			        // 调用接口时带上clinicId参数
			        const res = await docMarkById({ clinicId });
			        
			        if (res.code === 200) {
			          let rreess = res.data;
			          // 过滤掉不属于当前诊所的规则
			          rreess = rreess.filter(item => 
			            item.clinicId === clinicId || !item.clinicId
			          );
			          
			          this.checkValueInRange(rreess);
			        } else {
			          this.$message.error(res.message);
			        }
			      } catch (error) {
			        console.error('获取加成率出错:', error);
			        this.$message.error('获取加成率失败');
			      } finally {
			        this.loading = false;
			      }
			    },
			// 查看详情
			seeDeatils(){
				if(this.addForm.drugCodeName === ''){
					this.$message({ type: 'error', message: '请先选择一条药典数据'});
				}else{
					this.seeDetails = true;
				}
			},
			async getManufacturerList() {
			  try {
			    this.loading = true;
			    if (res.code === 200) {
			      this.ManufacturerData = res.data.map(item => ({
			        ...item,
			        editing: false,
			        originalData: {...item} // 保存原始数据用于取消编辑
			      }));
			    }
			  } finally {
			    this.loading = false;
			  }
			},
			handleDelete(index, row) {
			  this.$confirm('确认删除该生产厂家?', '提示', {
			    type: 'warning'
			  }).then(async () => {
			    try {
			      this.loading = true;
				  this.ManufacturerData.splice(index, 1);
			    } finally {
			      this.loading = false;
			    }
			  }).catch(() => {});
			},
			/* 打开新增修改等Model */
			async openAddModel(param) {
			  if (param) {
			    this.dialogFormVisible = true;
			    this.dialogTitle = param.label;
			    this.isShow = param.isShow;
			    this.MainFormAbled = !param.system;
			    this.editShow = param.system;
			    
			    if(param.label === '编辑' || param.label === '查看') {
					this.formTypeMain[11].disabled = true;
					// console.log(this.formTypeMain[11],'this.formTypeMain[18]this.formTypeMain[18]');
			      let res = await getDInfos({ id: param.id });
			      if (res.code === 200) {
			        this.addForm = JSON.parse(JSON.stringify(res.data));
			        // 处理特殊字段类型
			        this.addForm.allowDecimal = this.addForm.allowDecimal === 1;
			        this.addForm.selfProe = this.addForm.selfProe === 1;
			        // this.addForm.skintstDicm = this.addForm.skintstDicm === 1;
			        // this.addForm.antc = this.addForm.antc === 1;
			        this.ManufacturerData = JSON.parse(JSON.stringify(res.data.list || []));
			      }
			    } else {
			      // 新增逻辑
			      this.isShow = true;
			      this.dialogFormVisible = true;
			      this.dialogTitle = '新增';
				  this.formTypeMain[11].disabled = false;
			      // 重置表单
			      this.addForm = {};
			      this.ManufacturerData = [];
			    }
			  }
			},
			// 确定新增
			async submitForm(){
				//触发验证表单
				this.$refs.addForm.validate(async(valid) => {
				if(valid){
					this.MainFormAbled = false;
					this.$refs.addFormA.validate(async(validA) => {
					// 再次验证表单
					if(validA){
						// 检测生产厂家
						if(this.ManufacturerData.length === 0){
							this.$confirm('检测到您当前还未填写厂家信息, 是否前往填写?', '提示:厂家信息为必填项。', {
								confirmButtonText: '去填写',
								cancelButtonText: '关闭提示',
								type: 'warning'
							}).then(() => {
								this.activeTab = 'b'
							}).catch(() => {
								this.$message({ type: 'error', message: '厂家信息为必填项！'});
								this.GetManuFactDialogVisible = false;
								// this.resetAllFields();
							});
						}else{
								this.addForm.list = this.ManufacturerData;
								console.log('新增提交',this.addForm);
								// this.addForm.antc === false ? this.addForm.antc = 0 : this.addForm.antc = 1
								// this.addForm.skintstDicm === false ? this.addForm.skintstDicm = 0 : this.addForm.skintstDicm = 1
								let res = await addDrugInformation(this.addForm)
								if (res.code === 200){
								this.$message({ type: "success", message: res.message });
								 // 更新数据驱动 => 父组件 shopPlan
								this.parentMethod();
								this.resetAllFields();
								this.dialogFormVisible = false
								this.ManufacturerData = []; // 清空厂家数组
							}else{
								this.$message.error(res.message)
							}
						}
						}
					});
					}
				});
			},
			// 修改保存
			// 修改 submitEditForm 方法
			  async submitEditForm() {
			    try {
			      // 确保使用最新的 ManufacturerData
			      this.addForm.list = [...this.ManufacturerData];
			      
			      // 转换布尔值为数字
			      const formData = {
			        ...this.addForm,
			        allowDecimal: this.addForm.allowDecimal ? 1 : 0,
			        selfProe: this.addForm.selfProe ? 1 : 0,
			        // skintstDicm: this.addForm.skintstDicm ? 1 : 0,
			        // antc: this.addForm.antc ? 1 : 0
			      };
			      
			      console.log('提交的修改数据:', formData);
			      
			      const res = await updateDrugInformation(formData);
			      if (res.code === 200) {
			        this.$message.success(res.message);
			        this.parentMethod(); // 刷新父组件
			        this.dialogFormVisible = false;
			      } else {
			        this.$message.error(res.message);
			      }
			    } catch (error) {
			      this.$message.error('提交修改出错: ' + error.message);
			    }
			},
			// 清空所有表单
			resetAllFields(){
				this.$refs['addForm'].resetFields(); // 等待 DOM 更新后重置
				this.$refs['addFormA'].resetFields(); // 等待 DOM 更新后重置
				this.$refs['addFormB'].resetFields(); // 等待 DOM 更新后重置
				this.$refs['addFormC'].resetFields(); // 等待 DOM 更新后重置
			},
			handlefoucsC(v,i){
				this.idx = i;
				console.log(this.idx);
				switch (this.idx) {
				case 0: //药理类别
					this.selectOneCateGory();
				break;
				case 1: //药理类别2
					this.selectTwoCateGory();
				break;
				case 2: //药理类别3
					this.selectThreeCateGory();
				break;
				case 3:
					this.getDocVtByType(); // 毒麻类型
				break;
				}
			},
			// tabsA-Input聚焦
			handlefoucsA(v,i){
				this.idx = i;
				console.log(this.idx);
				switch (this.idx) {
					case 9:
						this.pacUnt(); // 包装单位
					break;
					
				}
			},
			async handleChangeA(v){
				// i event
				console.log(this.idx,v);
					
				switch (this.idx) {
					// case 18:
					// 	if(v === 1){
					// 		this.formTypeMain[this.idx + 1].disabled = false;
					// 	}else{
					// 		this.formTypeMain[this.idx + 1].disabled = true;
					// 		this.formTypeMain[this.idx + 1].modelValue = '';
					// 	}
					// break;
					// 加成方式选择
					case 23:
					 // 1比例,2固定3手工4不加成
						// 比例
						if(v===1){
							this.getDocMark();
							this.addForm.markUpFixed = 0;
							this.formTypeMain[this.idx + 2].disabled = true;
							this.formTypeMain[this.idx + 3].disabled = true;
							this.formTypeMain[this.idx + 2].label = "比例加成:"
							this.formTypeMain[this.idx + 2].modelValue = "markUpRate"
							this.addForm.markUpPric = 0;
							this.addRules.markUpPric = [];
							this.addRules.markUpRate = [ { required: true,pattern:/^[1-9]\d*(\.\d+)?$/, message: '格式错误！', trigger: 'blur' }];
							// 强制更新表单验证规则
							this.$nextTick(() => {
							  if (this.$refs.addForm) {
							    this.$refs.addForm.clearValidate(['markUpRate', 'markUpPric']);
							  }
							});
						}
						// 固定
						else if(v===2){
							this.formTypeMain[this.idx + 1].disabled = true;
							this.formTypeMain[this.idx + 1].modelValue = 'markUpFixed';
							this.addForm.markUpFixed = 1;
							this.formTypeMain[this.idx + 3].disabled = false;
							this.formTypeMain[this.idx + 2].label = "比例加成:"
							this.formTypeMain[this.idx + 2].disabled = true;
							this.formTypeMain[this.idx + 2].modelValue = "markUpRate"
							this.addForm.markUpRate = '';
							this.addRules.markUpRate = [];
							this.addRules.markUpPric = [ { required: true,pattern:/^[1-9]\d*(\.\d+)?$/, message: '格式错误！', trigger: 'blur' }];
							// 强制更新表单验证规则
							this.$nextTick(() => {
							  if (this.$refs.addForm) {
								this.$refs.addForm.clearValidate(['markUpRate', 'markUpPric']);
							  }
							});
						}
						// 手工比例
						else if(v === 3){
							this.addForm.markUpFixed = '';
							this.formTypeMain[this.idx + 2].label = "手工比例:"
							this.formTypeMain[this.idx + 2].type = "input"
							this.formTypeMain[this.idx + 2].modelValue = "markUpRate"
							this.addForm.markUpPric = 0
							this.formTypeMain[this.idx + 1].disabled = true;
							this.addRules.markUpRate = [
							  { required: true, message: '  ', trigger: 'blur' },
							  { pattern: /^[1-9]\d*$/, message: '请输入正整数', trigger: 'blur' },
							 //  { 
								// validator: (rule, value, callback) => {
								//   if (value > 100) {
								// 	callback(new Error('手工比例不能超过100%'));
								//   } else {
								// 	callback();
								//   }
								// },
								// trigger: 'blur'
							 //  }
							];
							this.addForm.markUpRate = ""
							this.addForm.markUpFixed = 0;
							this.formTypeMain[this.idx + 2].disabled = false;
							this.addForm.markUpPric = 0;
							this.addRules.markUpPric = [];
						}
						// 不加成
						else if(v===4){
							this.addForm.markUpFixed = 0;
							this.formTypeMain[this.idx + 2].label = "比例加成:"
							this.formTypeMain[this.idx + 2].modelValue = "markUpRate"
							this.formTypeMain[this.idx + 1].disabled = true;
							this.formTypeMain[this.idx + 2].disabled = true;
							this.formTypeMain[this.idx + 3].disabled = true;
							this.addForm.markUpFixed = '';
							this.addForm.markUpPric = 0;
							this.addRules.markUpRate = [];
							this.addRules.markUpPric = [];
							this.addForm.markUpRate = '';
							this.getSale();
							// 强制更新表单验证规则
							this.$nextTick(() => {
							  if (this.$refs.addForm) {
								this.$refs.addForm.clearValidate(['markUpRate', 'markUpPric']);
							  }
							});
						}
					break;
					
				}
			},
			// 不加成
			getSale(){
				this.addForm.salePric = this.addForm.costPric;
			},
			// tabsB-Input聚焦
			async handlefoucsB(v,i){
				this.idx = i;
				console.log(i);
				switch (i){
					
				}
			},
			// 药典名称 =. 西药
			handlefoucsName(v,i){
				this.idx = i;
				switch (i){
					case 0:
						this.drugName();
					break;
				}
			},
			/* 数据源 */
			
			// 获取正确的滚动容器
			getScrollContainer() {
			  // 尝试多种可能的滚动容器选择器
			  const containers = [
			    '.el-select-dropdown .el-scrollbar__wrap',
			    '.el-select-dropdown .el-select-dropdown__wrap',
			    '.el-select-dropdown .el-select-dropdown__list'
			  ];
			  
			  for (const selector of containers) {
			    const container = document.querySelector(selector);
			    if (container) {
			      return container;
			    }
			  }
			  return null;
			},
			// 绑定滚动事件
			bindScrollEvent() {
			  this.$nextTick(() => {
			    const container = this.getScrollContainer();
			    if (container) {
			      // 先移除旧的监听器，避免重复绑定
			      container.removeEventListener('scroll', this.handleScroll);
			      container.addEventListener('scroll', this.handleScroll);
			    }
			  });
			},
			// 修改drugName方法
			async drugName(isLoadMore = false) {
			  try {
			    if (!isLoadMore) {
			      this.loading = true;
			    } else {
			      this.scrollLoading = true;
			    }
			    
			    const res = await getDInfo({
			      productName: this.currentQuery,
			      pageNum: this.pageNum,
			      pageSize: this.isSearchMode ? 0 : this.pageSize
			    });
			    
			    if (res.code === 200) {
			      const newData = res.data.content.map(v => ({ 
			        label: v.productName, 
			        ...v,
			        _uid: Math.random().toString(36).substr(2, 9)
			      }));
			      
			      if (this.isSearchMode) {
			        // 搜索模式：保存所有结果
			        this.allSearchResults = newData;
			        
			        // 显示第一批数据
			        this.currentDisplayPage = 1;
			        this.displayedResults = this.allSearchResults.slice(0, this.displayBatchSize);
			        this.NameOptions = this.displayedResults;
			        
			        // 更新是否有更多数据
			        this.hasMore = this.displayedResults.length < this.allSearchResults.length;
			      } else {
			        // 普通浏览模式
			        if (isLoadMore) {
			          this.NameOptions = [...this.NameOptions, ...newData];
			        } else {
			          this.NameOptions = newData;
			        }
			        this.hasMore = res.data.content.length >= this.pageSize;
			      }
			    }
			  } catch (error) {
			    console.error('获取药品数据出错:', error);
			  } finally {
			    this.loading = false;
			    this.scrollLoading = false;
			  }
			},
			
			// 修改searchNameMethod方法
			searchNameMethod: _.debounce(function(query) {
			  this.currentQuery = query.trim();
			  this.pageNum = 1;
			  this.isSearchMode = true;
			  
			  if (!this.currentQuery) {
			    this.isSearchMode = false;
			    this.allSearchResults = [];
			    this.drugName();
			    return;
			  }
			  
			  // 重置状态
			  this.allSearchResults = [];
			  this.displayedResults = [];
			  this.currentDisplayPage = 1;
			  this.hasMore = true;
			  
			  this.drugName();
			}, 500),
			// 获取滚动容器（修正后的选择器）
			  getScrollWrap() {
				return document.querySelector('.el-select-dropdown .el-scrollbar__wrap') || 
					   document.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
			  },
			// 滚动事件处理
			  handleScroll() {
			    const scrollWrap = this.getScrollWrap();
			    if (!scrollWrap || !this.isSearchMode || !this.hasMore || this.scrollLoading) return;
			
			    clearTimeout(this.scrollDebounce);
			    this.scrollDebounce = setTimeout(() => {
			      const { scrollTop, scrollHeight, clientHeight } = scrollWrap;
			      // 增加10px的缓冲区域，确保触发
			      if (scrollHeight - (scrollTop + clientHeight) < 10) {
			        this.loadMoreSearchResults();
			      }
			    }, 200);
			  },


			
			// 加载更多数据
			  loadMoreSearchResults() {
			    if (!this.hasMore || this.scrollLoading) return;
			    
			    this.scrollLoading = true;
			    this.currentDisplayPage++;
			    
			    const startIndex = 0;
			    const endIndex = this.currentDisplayPage * this.displayBatchSize;
			    this.displayedResults = this.allSearchResults.slice(0, endIndex);
			    
			    // 更新select选项
			    this.NameOptions = this.displayedResults;
			    this.hasMore = endIndex < this.allSearchResults.length;
			    
			    this.scrollLoading = false;
			    
			    // 滚动后需要重新绑定事件
			    this.$nextTick(() => {
			      const scrollWrap = this.getScrollWrap();
			      if (scrollWrap) {
			        scrollWrap.addEventListener('scroll', this.handleScroll);
			      }
			    });
			  },

			/* datas */
			//病案费别
			async getMedcas(){
				this.res = await getMedcas();
				if(this.res.code===200){ 
					this.medicalRecordFeeOption=this.res.data.map(v => {return { label: v.name, ...v}})
				}
			},
			// 用药频率
			async getMedicationWay(){
				let res = await getMedicationWay();
				if(res.code===200){ this.medcWayIdOptions=res.data.map(v => {return { label: v.name, ...v}}) }else{ this.$message.error(res.message) }
			},
			// 给药方式
			async getMedicationFrequency(){
				let res = await getMedicationFrequency();
				if(res.code===200){ this.usedFrquIdOptions=res.data.map(v => {return { label: v.name, ...v}}) }else{ this.$message.error(res.message) }
			},
			// 包装单位
			async pacUnt(){
				let res = await getDrugUnt();
				if(res.code===200){ this.unitDoseOptions=res.data.map(v => {return { label: v.name, ...v}}) }else{ this.$message.error(res.message) }
			},
			// 剂量单位
			async getDosaUnts(){
				let res = await getDosaUnt();
				if(res.code===200){ 
					// 最小单位 && 剂量单位
					this.getDosaUntOptions = this.getDosaUntOptions=res.data.map(v => {return { label: v.name, ...v}}) }else{ this.$message.error(res.message)
				}
			},
			// 毒麻
			async getDocVtByType(){
				let res = await selectDocVtByType()
				this.poisonousTypeOption = res.data.map(v => {return { label: v.name, ...v}})
			},
			// 药理类别
			async selectOneCateGory(){
				let res = await selectOneCateGory();
				if(res.code===200){ 
					this.drugCategoryOption=res.data
				}
			},
			kkkk(val){
				console.log(val);
			},
			// 药理类别2
			async selectTwoCateGory(){
				let res = await selectTwoCateGory({idcode:this.idcode});
				if(res.code===200){ 
					this.drugCategoryChildOption=res.data
					console.log(this.drugCategoryChildOption);
				}
			},
			// 药理类别3
			async selectThreeCateGory(){
				let res = await selectThreeCateGory({idcode:this.idcode});
				if(res.code===200){ 
					this.threeLevelDrugCategoryOption=res.data
				}
			},
			// select聚焦
			async handlefoucs(v,i){
				this.idx = i;
				console.log(i);
				switch(this.idx){
					case 15:
						// console.log('1111111111111')
					break;
				}
			},
			// 编辑行
			  handleEdit(index, row) {
			    this.$set(this.tableData, index, {
			      ...row,
			      editing: true  // 添加编辑状态
			    });
			  },
			  
			  // 保存编辑
			  saveEdit(index) {
			    const row = this.tableData[index];
			    // 这里可以添加验证逻辑
			    this.$set(this.tableData, index, {
			      ...row,
			      editing: false
			    });
			    // 调用API保存修改
			    this.saveManufacturer(row);
			  },
			  
			  // 取消编辑
			  cancelEdit(index) {
			    const row = this.tableData[index];
			    if (row.originalData) {
			      // 恢复原始数据
			      this.$set(this.tableData, index, {
			        ...row.originalData,
			        editing: false
			      });
			    } else {
			      // 如果没有原始数据，只是退出编辑状态
			      this.$set(this.tableData, index, {
			        ...row,
			        editing: false
			      });
			    }
			  },
			  ads(v){
				console.log(v); // 这里会是 1 或 0
			  },
			  // 保存到后端
			  async saveManufacturer(row) {
			    try {
			      this.loading = true;
			      const res = await updateManufacturer(row);
			      if (res.code === 200) {
			        this.$message.success(res.message);
			      } else {
			        this.$message.error(res.message)
			      }
			    } catch (error) {
			      this.$message.error(res.message)
			    } finally {
			      this.loading = false;
			    }
			  },
			// 药典选择之后快速填充
			handleNameChange(val){
				// 通过id去找到对应的对象
				let NameResult = this.NameOptions.find(name => name.id === val)
				// console.log(NameResult,'去找到对应的对象');
				this.drugData = NameResult;
				if(NameResult){
					this.addForm.dosform = NameResult.dosageForm
					this.addForm.drugType = NameResult.drugType
					this.addForm.code = NameResult.drugCode
					this.addForm.drugCodeId = NameResult.id
					this.addForm.drugName = NameResult.label
					this.addForm.drugCodeName = NameResult.label
					this.addForm.drugSpec = NameResult.specifications
					this.addForm.drugType = 1
					this.addForm.pyCode = this.makePy(this.addForm.drugName).toUpperCase();
				}
			},
			handleChange(v){
				
			},
			// 表格单选
			handleCurrentTableChange(val){
				console.log(val);
				this.currentTable = val
			},
			// 取消高亮
			setCurrent(row) {
			    this.$refs.ManFacterTable.setCurrentRow(row);
			},
			async handleChangeC(v){
				// i event
				console.log(this.idx,v);
				switch(this.idx){
					// case 0:
					// if(v === 0){ this.disabledC = true;	this.addForm.basMednType='' }else{ this.disabledC = false }
					// break;
					case 0:
					if(this.addForm.phamType1){
						// 根据 NameOptions绑定的id 找到对应的对象
						let phamObj = this.drugCategoryOption.find(name => name.id === v)
						this.idcode = phamObj.idcode
						this.formTypeMainC[this.idx + 1].disabled = false;
					}else{
						this.formTypeMainC[this.idx + 1].disabled = true;
						this.addForm.basMednType = ''
					} 
					break;
					case 1:
					if(this.addForm.phamType1){
						// 根据 NameOptions绑定的id 找到对应的对象
						let phamObj2 = this.drugCategoryChildOption.find(name => name.id === v)
						this.idcode = phamObj2.idcode
						this.formTypeMainC[this.idx + 1].disabled = false;
					}else{
						this.formTypeMainC[this.idx + 1].disabled = true;
						this.addForm.basMednType = ''
					} 
					break;
				}
			},
			removeAllSpaces(str) {
			  return str.trim().replace(/\s+/g, '');
			},
			/* props */
			searchMethod(query, option) {
				query = this.removeAllSpaces(query);
				console.log(query);
				if(query){
					this.loading = true
					this.inputSearchManfactValue = query
					this.pageNum = 0
					this.pageSize = 0
					this.loadData();
					this.loading = false
				}else{
					this.inputSearchManfactValue = query
					this.pageNum = 1
					this.pageSize = 28
					this.loadData();
				}
			},
			// son btn events
			boxaBtnHandClick(i){
				// i event
				switch (i) {
					case 0:
						this.GetManuFactDialogVisible = true;
						this.addManfacterFormType = addManFacterType.map(function(val) { return val }) // 赋值厂家表单
						this.loadData();
						console.log(this.addManfacterForm,'厂家表单')
						break;
					case 1:
						// 处理索引1的逻辑
						if(this.currentTable.length === 0){
							this.$message.warning('请先选择您想要操作的数据!');
						}else{
							this.loadData();
							this.GetManuFactDialogVisible = true;
							this.addManfacterFormType = addManFacterType.map(function(val) { return val }) // 赋值厂家表单
							this.addManfacterForm = this.currentTable
						}
						break;
					case 2:
						// 处理索引2的逻辑 => 新增
						console.log('删除',this.ManufacturerData,this.currentTable)
						
						break;
				}
			},
			// 厂家选择变更处理 - 确保正确更新表单数据
			handleChangeManfacter(v) {
			    let Manfacters = this.ManufacturerOptions.find(id => id.prodentpId === v);
			    if (Manfacters) { 
			        this.addManfacterForm = {
			            ...this.addManfacterForm,
			            manufacturerName: Manfacters.label,
			            orplc: Manfacters.origin,
			            id: Manfacters.prodentpId,
			            prodentpId: Manfacters.prodentpId
			        };
			    }
			},
			// 确认保存厂家
			GetManuFact() {
			  // 检查是否已存在相同 prodentpId 的记录
			  const existingIndex = this.ManufacturerData.findIndex(
			    item => item.prodentpId === this.addManfacterForm.prodentpId
			  );
			  
			  if (existingIndex !== -1) {
			    // 如果存在，则更新该记录
			    this.$set(this.ManufacturerData, existingIndex, JSON.parse(JSON.stringify(this.addManfacterForm)));
			    this.$message.success('厂家信息已更新');
				console.log(this.ManufacturerData,'ManufacturerDataManufacturerData')
			  } else {
			    // 如果不存在，则新增记录
			    this.ManufacturerData.push(JSON.parse(JSON.stringify(this.addManfacterForm)));
			    this.$message.success('厂家信息已添加');
				console.log(this.ManufacturerData,'ManufacturerDataManufacturerData')
			  }
			  
			  // 关闭对话框并清空表单
			  this.GetManuFactDialogVisible = false;
			  this.addManfacterForm = {}; // 清空表单
			},
			// col 里面包含了表头字段和名称，list 是表格数据
			columnWidth(col, list) {
				let prop = col.prop,lab = col.lab;
				let width = 20; // 设定一个最小值
				let maxlenStr = ""; // 最长字符串
				for (let info of list) {
				if (maxlenStr < (info[prop] + "").length) maxlenStr = info[prop];
			}
			width = Math.max(width, len(lab), len(maxlenStr));
			// 表格自带的内边距(20px) 自调
			return width + 12; // 这里加了 12px
			function len(str) {
				// 实际分配长度可根据需要自行调整
				let length = 8;
				for (const char of str + "") {
				  // 英文小写字符 8px
				  if ("a" <= char && char <= "z") length += 8;
				  // 英文大写字符 8px
				  else if ("A" <= char && char <= "Z") length += 8;
				  // 中文字符 28px
				  else if (char >= "\u4e00" && char <= "\u9fa5") length += 12;
				  // 其他 8px
				  else length += 12;
				}
				return length;
			}
			},
			columnManufacturerWidth(col, list) {
				let prop = col.prop,lab = col.lab;
				let width = 40; // 设定一个最小值
				let maxlenStr = ""; // 最长字符串
				for (let info of list) {
				if (maxlenStr < (info[prop] + "").length) maxlenStr = info[prop];
			}
			width = Math.max(width, len(lab), len(maxlenStr));
			// 表格自带的内边距(20px) 自调
			return width + 12; // 这里加了 12px
			function len(str) {
				// 实际分配长度可根据需要自行调整
				let length = 8;
				for (const char of str + "") {
				  // 英文小写字符 8px
				  if ("a" <= char && char <= "z") length += 8;
				  // 英文大写字符 8px
				  else if ("A" <= char && char <= "Z") length += 8;
				  // 中文字符 28px
				  else if (char >= "\u4e00" && char <= "\u9fa5") length += 26;
				  // 其他 8px
				  else length += 12;
				}
				return length;
			}
			},
			// 药典失焦
			inputChanceName(val){
				// console.log(val.target.value,'pppppppppppp');
				this.addForm.pyCode = this.makePy(this.addForm.name).toUpperCase();
				this.addForm.name != '' ? this.MainFormAbled = false : this.MainFormAbled = true;
			},
			// 多选框转换是否01
			toggleYesNo(value) {
				// this.addForm.allowDecimal = value ? 1 : 0;
				// this.addForm.antc = value ? 1 : 0;
				// this.addForm.skintstDicm = value ? 1 : 0;
				// this.addForm.selfProe = value ? 1 : 0;
			},
			toggleSkintstDicmYesNo(v){
				this.addForm.selfProe = value ? 1 : 0;
			},
			// input失焦 简码转换赋值
			inputHeaderChance(v,i){
				console.log(i,'input失焦');
				// i event
				switch (i) {
					case 3:  // 通用名失焦开始赋值
						this.addForm.alisPyCode = this.makePy(this.addForm.alis).toUpperCase()
					break;
					
					case 25:
						this.addForm.salePric = Number(this.addForm.costPric) + this.addForm.costPric * (parseFloat(this.addForm.markUpRate) / 100)
					break;
					case 26: // 加成金额开始赋值
						this.addForm.salePric = Number(this.addForm.costPric) + Number(this.addForm.markUpPric)
					break;
				}
			},
			inputChance(v,i){
				console.log(i);
			},
			// 时间处理
			changDate(val){
				let i = this.idx
				switch(i) {
					case 5:
					function formatDate(date) {
					  const year = date.getFullYear();
					  const month = (date.getMonth() + 1).toString().padStart(2, '0');
					  const day = date.getDate().toString().padStart(2, '0');
					  return `${year}-${month}-${day}`;
					}
					 
					// 使用示例
					const now = new Date();
					this.addForm.dateOfEmp = formatDate(val);
				}
			},
			// 选项卡切换回调（可选）
			handleTabChange(tab) {
			  console.log('当前选项卡:', tab.name);
			},
			// 地区处理
			handleSelectCost(val) {
			  this.addForm.nativePlace = val.join(',')
			},
			// 关闭Model
			handleClose(done) {
				if(this.dialogTitle == '新增'){
					this.$confirm('关闭不会保存内容，确认关闭？',{ type: 'warning' })
						.then(_ => {
						// 先重置表单
						// this.$nextTick(() => {
						//    // 等待 DOM 更新后重置
						// });
						// 再执行关闭
						this.dialogFormVisible = false;
						this.resetAllFields();
						// 确保重置完成后再关闭
						// done();
						// setTimeout(() => done(), 0); 
					}).catch(_ => {});
				}else{
					// 直接执行关闭
					this.dialogFormVisible = false;
					this.resetAllFields();
				}
				
			},
			// 关闭Model 新增厂家
			handleMacnFactClose(done) {
			    done();
			},
			// 关闭药典详情Model
			handleCloseDetails(done){
				done();
			},
			// 自定义校检规则
			// 包装数量
			validatePacCnt(rule, value, callback) {
				// 正则校验规则：确保输入值只能为数字
				const regex = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
				if (!regex.test(value)) {
				  callback(new Error('包装数量格式错误！'));
				} else {
				  callback();
				}
			},
			// 参考零售单价
			validatesalePric(rule, value, callback) {
			    if (value === '') {
			        callback(); // 如果为空，不进行校验
			    } else{
					// 正则校验规则：确保输入值只能为数字
					const regex = /^[0-9]+$/;
					if (!regex.test(value)) {
					  callback(new Error('为数字'));
					} else {
					  callback();
					}
				}
			},
			// 在beforeDestroy中移除监听
			beforeDestroy() {
			  const selectDropdown = document.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
			  if (selectDropdown) {
			    selectDropdown.removeEventListener('scroll', this.handleScroll);
			  }
			}
			
		},

	}
</script>

<style lang="less" scoped>
	// /deep/ .el-form-item__error {
	// 	  position: absolute;
	// 	  left: 88px;
	// 	  top: 50%;
	// 	  transform: translateY(-50%);
	// 	}
	/deep/ .el-select-dropdown__item {
		// height: 36px;
		font-size: 12px;
		padding: 0;
		border: 1px solid #f1f1f1;
		display: flex;
		align-items: center;
	}
	
.content{
	height: 100%;
	width: 100%;
	
	.header{
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: #007bb0;
		padding: 4px;
	}
	.main{
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		// 穿透
		/deep/ .el-dialog__header{
			padding: 4px 8px;
			background-color: #007bb0;
		}
		/deep/ .el-dialog__title{
			font-size: 12px;
			color: #fff;
		}
		/deep/ .el-dialog__headerbtn{
			top: 10px;
		}
		/deep/ .el-dialog__headerbtn .el-dialog__close:hover{
			color: firebrick;
		}
		/deep/ .el-dialog__headerbtn .el-dialog__close{
			color: #fff;
		}
		/deep/ .el-dropdown-menu__item{
			font-size: 12px;
		}
		/deep/ .el-dialog__body{
			padding: 10px;
		}
		/deep/ .el-descriptions{
			font-size: 12px !important;
		}
		/deep/ .el-descriptions-item__container{
			display: flex !important;
			// align-items: center !important;
			padding-top: 12px !important;
		}
		/deep/ .el-descriptions-item__label:not(.is-bordered-label){
			padding-left: 0;
			width: 66px;
			display: flex;
			justify-content: left;
		}
		/deep/ .el-color-picker__icon, .el-input, .el-textarea{
			width: 100%;
		}
		.add{
			width: 100%;
		.formTypeHeader{
			/deep/ .el-form{
				padding: 12px;
				display: flex;
				border: 1px solid #DCDFE6;
			}
			/deep/ .el-form-item{
				margin-bottom: 12px;
				display: flex;
				align-items: center;
				font-size: 12px;
			}
			/deep/ .el-tabs--border-card{
				width: 100%;
			}
			/deep/ .el-input--mini .el-input__inner{
				height: 26px;
			}
			/deep/ .el-form-item__content{
				margin-left: -8px;
			}
			/deep/ .el-form-item__label{
				font-size: 12px;
				width: 100px;
			}
			.select-header{
				span{
					width: 168px;
					text-align: center;
				}
			}
			#optionItem {
				width: 100%;
				height: 100%;
				display: flex;
				align-items: center;
				text-align: left;
				justify-content: space-between;
				span{
					padding-left: 8px;
					border: 1px solid #f1f1f1;
					display: inline-block;
					width: 168px;
					font-size: 12px;
					// height: 26px;
					// line-height: 26px;
					white-space: nowrap;      /* 禁止换行 */
					overflow: hidden;         /* 隐藏溢出内容 */
					text-overflow: ellipsis;  /* 溢出显示省略号 */
				}
			}
		}
		.formTypeMain{
			margin-top: 12px;
			.table{
				/deep/ .el-table{
					font-size: 12px;
					width: 100%;
				}
				/deep/ .el-table tr{
					font-size: 12px;
				}
			}
			.addFormA{
				/deep/ .el-form-item{
					display: flex;
					justify-content: space-around;
					margin-bottom: 4px;
				}
				/deep/ .el-form-item__label{
					width: 88px;
					font-size: 12px;
				}
				/deep/ .el-input--mini .el-input__inner{
					height: 26px;
				}
				/deep/ .el-select-dropdown__item {
					font-size: 12px;
				}
				.selectInput{
					display: flex;
					justify-content: space-between;
					/deep/ .el-input{
						width: 60px;
					}
					/deep/ .el-select>.el-input{
						width: 86px;
						// margin-left: 56px;
					}
					/deep/ .el-form-item{
						display: flex;
						margin-left: 8px;
						justify-content: space-around;
						margin-bottom: 12px;
					}
					/deep/ .el-form-item__label{
						width: 88px;
						font-size: 12px;
					}
				}
				.selectInput2{
					display: flex;
					justify-content: space-between;
					/deep/ .el-input{
						width: 60px;
					}
					/deep/ .el-select>.el-input{
						width: 58px;
						// margin-left: 4px;
						// margin-left: 56px;
					}
					/deep/ .el-form-item{
						display: flex;
						justify-content: space-around;
						// margin-bottom: 12px;
					}
					/deep/ .el-form-item__label{
						width: 80px;
						font-size: 12px;
					}
				}
			}
			.addFormB{
				/deep/ .el-select>.el-input{
					width: 100%;
				}
				.table{
					/deep/ .el-table{
						// font-size: 12px;
						width: 100%;
					}
					/deep/ .el-table .cell{
						font-size: 12px;
						font-weight: 400;
						color: #0c0c0c;
						text-align: center;
					}
					/deep/ .el-input--mini .el-input__inner{
						height: 26px;
					}
					/* 自定义高亮颜色 */
					::v-deep .el-table__body tr.current-row > td {
					  background-color: #00557f !important;
					  color: #f9f9f9; /* 可选：修改文字颜色 */
					}
					/deep/ .el-table .el-table__cell{
						padding: 8px 0;
					}
				}
				/* 自定义高亮颜色 */
				::v-deep .el-table__body tr.current-row > td {
				  background-color: #00557f !important;
				  color: #f9f9f9; /* 可选：修改文字颜色 */
				}
				/deep/ .el-form{
					padding: 8px 0;
					display: flex;
					align-items: center;
					justify-content: center;
				}
				/deep/ .el-input--mini .el-input__inner{
					height: 26px;
				}
				
			}
			/deep/ .el-input--mini .el-input__inner{
				height: 26px;
			}
			.addFormC{
				/* 自定义高亮颜色 */
				::v-deep .el-table__body tr.current-row > td {
				  background-color: #00557f !important;
				  color: #f9f9f9; /* 可选：修改文字颜色 */
				}
				/deep/ .el-table .el-table__cell{
					padding: 8px 0;
				}
				/deep/ .el-form-item{
					margin-bottom: 4px;
					font-size: 12px;
				}
				/deep/ .el-form-item__label{
					font-size: 12px;
				}
				/deep/ .el-input--mini .el-input__inner{
					height: 26px;
				}
			}
		}	
		
		
		.form-feet {
		  /* margin-top: 1px; */
		}
		
		.CJ {
		  border: 1px solid #e6e6e6;
		  border-radius: 4px;
		  overflow: hidden;
		}
		
		.CJ-title {
		  display: flex;
		  justify-content: space-between;
		  align-items: center;
		  padding: 8px 15px;
		  background: #00557f;
		  color: white;
		  font-size: 14px;
		}
		
		.title-text {
		  font-weight: bold;
		  font-size: 12px;
		}
		
		.title-buttons .el-button {
		  padding: 0px;
		  color: white;
		}
		
		.CJ-table {
		  width: 100%;
		}
		
		.el-table {
		  width: 100%;
		}
		
		.el-table--scrollable-x .el-table__body-wrapper {
		  overflow-x: auto;
		}
		
		.el-table--scrollable-y .el-table__body-wrapper {
		  overflow-y: auto;
		}
		
		.dialog-footer {
		  text-align: right;
		  padding: 10px 10px 0;
		  border-top: 1px solid #e6e6e6;
		  font-size: 12px;
		  .el-button{
			
		  }
		}
		
		}
		.dialog-footer{
			margin-top: 12px;
			display: flex;
			justify-content: right;
		}
	}
	// 西药药典详情 Model
	.details{
		// 穿透
		/deep/ .el-dialog__header{
			padding: 4px 8px;
			background-color: #007bb0;
		}
		/deep/ .el-dialog__title{
			font-size: 12px;
			color: #fff;
		}
		/deep/ .el-dialog__headerbtn{
			top: 10px;
		}
		/deep/ .el-dialog__headerbtn .el-dialog__close{
			color: #fff;
		}
		/deep/ .el-dropdown-menu__item{
			font-size: 12px;
		}
		/deep/ .el-dialog__body{
			padding: 10px;
		}
	}
	
	.feet{
		.GetManuFact{
			// 穿透
			/deep/ .el-dialog__header{
				padding: 4px;
				background-color: #007bb0;
			}
			/deep/ .el-dialog__title{
				font-size: 12px;
				color: #fff;
			}
			/deep/ .el-dialog__headerbtn{
				top: 10px;
			}
			/deep/ .el-dialog__headerbtn .el-dialog__close:hover{
				color: firebrick;
			}
			/deep/ .el-dialog__headerbtn .el-dialog__close{
				color: #fff;
			}
			/deep/ .el-icon-arrow-left:before {
			    content: "\e67d";
			    font-size: 18px;
			}
			/deep/ .el-icon-arrow-down:before {
			    content: "\e659";
			    font-size: 12px;
			}
			/deep/ .el-dropdown-menu__item{
				font-size: 12px;
			}
			/deep/ .el-dropdown-menu__item{
				font-size: 12px;
			}
			/deep/ .el-dialog__body{
				padding: 15px 20px;
			}
			
			// form
			.form{
				/deep/ .el-select-dropdown__item{
					border: 1px solid #eeeeee;
					padding: 0;
					height: 28px;
					width: 100%;
					#optionItem {
						 user-select: text !important;
						  -webkit-user-select: text !important;
						width: 100%;
						height: 100%;
						display: flex;
						align-items: center;
						text-align: center;
						justify-content: center;
						span{
							display: inline-block;
							font-size: 12px;
							width: 128px;
							height: 30px;
							line-height: 30px;
							white-space: nowrap;      /* 禁止换行 */
							overflow: hidden;         /* 隐藏溢出内容 */
							text-overflow: ellipsis;  /* 溢出显示省略号 */
						}
					}
				}
				/deep/ .el-select-dropdown__wrap{
					max-height: 168px;
				}
				/deep/ .el-form{
					padding: 12px;
					display: flex;
					align-items: center;
					border: 1px solid #DCDFE6;
				}
				// /deep/ .el-input{
				// 	width: 168px;
				// }
				/deep/ .el-input--mini .el-input__inner{
					height: 26px;
				}
				/deep/ .el-form-item{
					margin-bottom: 18px;
					display: flex;
				}
				/deep/ .el-form-item__content{
					display: flex;
					font-size: 12px;
					width: 100%;
					/deep/ .el-table{
						width: 100%;
					}
				}
				/deep/ .el-form-item__label{
					font-size: 12px;
					width: 88px;
					text-align: left;
				}
			}
			
		}
	}
}
</style>